﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Satates.FarmerStates;

namespace Operators.FarmerOperators
{
   public class MoveSheepLeft:iOperator
    {
        public override string ToString()
        {
            return "Moving Sheep Left";
        }
        public int getOperatorNumber()
        {
            return 3;
        }
        public FarmerStates execute(FarmerStates s)
        {
            FarmerStates s2 = new FarmerStates(s);
            s2.setLeftSheep(1);
            s2.setRightSheep(0);
            s2.setLeftFarmer(1);
            s2.setRightFarmer(0);

            return s2;

        }

        public bool available(FarmerStates s)
        {
            if (s.getRightFarmer() == 1 && s.getRightSheep() == 1)
                return true;
            return false;
        }

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        public Common.Template execute(Common.Template t)
        {
            FarmerStates s2 = (FarmerStates)t;
            s2.setLeftSheep(1);
            s2.setRightSheep(0);
            s2.setLeftFarmer(1);
            s2.setRightFarmer(0);

            return s2;
        }

        public bool available(Common.Template t)
        {
            FarmerStates s = (FarmerStates)t;
            if (s.getRightFarmer() == 1 && s.getRightSheep() == 1)return true;
            return false;
        }
    }
}
